#ifndef xpack_graphic_draw_linev
#define xpack_graphic_draw_linev
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::graphic_draw_linev::inc
#include"define/base_type.hpp"
#include"graphic/private/rander_helper.hpp"
#include"macro/xexport.hpp"
#include"math/point.hpp"
#pragma pop_macro("xuser")

namespace mixc::graphic_draw_linev::origin{
    template<class rander_t>
    inline void linev(inc::pt2wx p, uxx height_of_bottom_to_top, rander_t const & rander){
        auto old_mode   = inc::rander_helper::get_thickness_mode(rander);
        inc::rander_helper::set_thickness_mode(rander, inc::thickness_mode_t::become_wider);

        // 避免传负数，使用 ixx 判断
        while(ixx(height_of_bottom_to_top--) > 0){
            rander(p->x(), p->y());
            p = p(0, 1);
        }
        inc::rander_helper::set_thickness_mode(rander, old_mode);
    }

    template<class rander_t>
    inline void linev(uxx height_of_bottom_to_top, rander_t const & rander){
        linev({}, height_of_bottom_to_top, rander);
    }
}
#endif

xexport_spacex(draw, mixc::graphic_draw_linev::origin)
